<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", 0);
	response.setContentType("text/html;charset=UTF-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>员工管理</title>
	<link rel="stylesheet" href="css/style.css" type="text/css"></link>
  	<script type="text/javascript" src="js/win_center.js"></script>
 	<script type="text/javascript" src="js/pos_depart.js"></script>
  	<script type="text/javascript" src="js/jquery-1.6.js"></script>
  	<script type="text/javascript" src="js/hidden.js"></script>
  	<script type="text/javascript">
  		function confimDel(){
			var r = confirm("确定该员工要离职?");
			if(r==true){
				location.href="delEmployee?id="+$("#userId")[0].value;
			}
	}
  	</script>
  	</head>
  
  <body>
  <div class="top">
  		<img src="images/main_28.gif"/>&nbsp;&nbsp;员工管理
  	</div><br/>
  	<div id="selectIno">
  		<form action="toEmployeeManager" method="post">
			<table>
				<tr class="select">
					<td>
					姓名：
					      <input name="userName" type="text" class="input" size="30"/>
					员工编号:
					 	<input name="userId" type="text" class="input" size="30"/>
					部门: 	<select name="departmentId" id="department" onchange="changeDaperment();">
								<option>请选择职位</option>
								<s:iterator value="departments">
									<option value="<s:property value='departmentId'/>">
										<s:property value="departmentName"/>
									</option>
								</s:iterator>
							</select>
							职位:
							<span id="position">
							<select>
							<option>请选择职位</option>
						</select>
						</span>
						&nbsp;<input name="Submit" type="submit" class="buttonface" value="  查询  "/>
					</td>
				</tr>
			</table>
		</form>
  	</div>
	<br/>
  	<div>
  		<display:table decorator="org.displaytag.decorator.CheckboxTableDecorator" name="employees"  requestURI="/toEmployeeManager" class="paging" defaultorder="descending" id="employee" pagesize="10">
  			<display:column property="userId" title="员工编号" headerClass="td_top" class="td_02" sortable="true"></display:column>
  			<display:column property="userName" title="员工姓名" headerClass="td_top" class="td_02" sortable="true"></display:column>
  			<display:column property="position.department.departmentName" title="所属部门" headerClass="td_top" class="td_02" sortable="true">
  			</display:column>
  			<display:column property="position.positionName" title="职位" headerClass="td_top" class="td_02" sortable="true">
  			</display:column>
  			<display:column title="离职操作" headerClass="td_top" class="td_02" sortable="true">
  			<a href="#" onclick="confimDel();">离职</a>
  			<input type="hidden" id="userId" value="${employee.userId}"/>
  			</display:column>
  			<display:column title="详细信息" paramId="id" paramProperty="userId" class="td_02" headerClass="td_top">
  				<a href="#" onclick="javascript:openwindow('getEmpInfo?id=${employee.userId}','',1000,500)">&nbsp;&nbsp;&gt;&gt;&gt; </a>
  			</display:column>
  		</display:table>
  	</div>
  </body>
</html>
